function v = featuresZernike( Img, featureArgs, ve)
%featuresZernike spocita zernikovy momenty pro obrazek Img
%       Img -  fotka
%       featureArgs - osahuje vektor se stupnemi m ktere se maji pocitat -
%           vsechny stupne m ktere k nim odpovidaji jsou spocitany a
%           vraceny ve vektoru v
%       ve - elipsa kolem obliceje [r1 r2 cx cy theta]  (volitelny p.)


%nastaveni defaultnich hodnot parametru

if nargin < 3
   addpath('./elipse');
   [x0, y0] = findCenter(Img);
   r = 0.8*min([(SizeY - y0) y0 (SizeX - x0) x0]);
   
   if nargin < 2
      featureArgs = [9 10];
   end;
   
else
   x0 = ve(3);
   y0 = ve(4);
   r = min(ve([1 2]));
end  


addpath('./zernike');


I = im2double(Img);

%vypocet disku (D)
[SizeY, SizeX] = size(Img);
[X Y] = meshgrid((1:SizeX) - x0, (1:SizeY) - y0);
D = sqrt(X .^2 + Y .^2) ./ r;
In = D < 1;
[x y] = find(In == 1);
I = I(min(x):max(x),min(y):max(y));

V = lans_zmoment(I,featureArgs);
v = zeros(size(V,2) * 2,1);
for s = 1:size(V,2)
    v(1 + 2 *(s - 1),1) = real(V(s));
    v(2 + 2 *(s - 1),1) = imag(V(s));
end
end



